package com.toymate.modules.iot;

import com.toymate.ai.llm.LLMFactory;
import com.toymate.common.web.Result;
import com.toymate.modules.iot.entity.IotRole;
import com.toymate.modules.iot.service.IotRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * IotController
 *
 * @author weirdor (179946422@qq.com)
 * @version v1.0.0
 */
@RestController
@RequestMapping("/iot")
public class IotController {

    @Autowired
    private IotRoleService iotRoleService;

    @GetMapping("/llm")
    public Result<?> llm(String roleId) {
        IotRole iotRole = iotRoleService.getById(roleId);
        LLMFactory.build(iotRole).chat("你好", "1", "D19O28377XY9");
        return Result.ok();
    }
}
